cmake_minimum_required(VERSION 3.10)
project(Test)
set(CMAKE_CXX_STANDARD 17)
# # # # 以下内容禁止修改 # # # #
option(BUILD_A "build modules a" ON)
option(BUILD_B "build modules b" OFF)
option(BUILD_TESTS "build tests" OFF)

if(BUILD_TESTS)
    enable_testing()
endif()

add_subdirectory(modules)
add_subdirectory(common)
# 小提示: module2 需要用到 pthread，即 target_link_libraries(xxx pthread)
# # # # 以上内容禁止修改 # # # #

add_executable(client client.cpp)
add_executable(server server.cpp)
target_link_libraries(client  module2)
if(BUILD_A)
    add_definitions(-DWITH_A)
    target_link_libraries(server module1a rmath assembly1 assembly2 module2 singleton)
endif()
if(BUILD_B)
    add_definitions(-DWITH_B)
    target_link_libraries(server module1b rmath assembly1 assembly2 module2 singleton)
endif()


